<template>
  <div class="index-banner">
    <img :src="src" alt="">
  </div>
</template>

<script>
export default {
  props: {
    bannerList: Array
  },
  computed: {
    src() {
      if (Array.isArray(this.bannerList) && this.bannerList.length > 0) {
        return this.bannerList[0].image;
      }
      return '';
    }
  },
  mounted() {
    console.log(this.bannerList);
  }
};
</script>

<style lang="less" scoped>
.index-banner {
  width: 100%;
  overflow: hidden;
  img {
    width: 100%;
  }
}
</style>